<div class="menu_top">
	<input type="hidden" name="action" value="list_shipping" />
	<img title="<?php echo ucfirst($txt->getWord('save')); ?>" class="icon command" src="<?php echo SYSICONS_URL; ?>filesave_22.gif" onclick="edit_form.submit();"  />
</div>
<div class="menu_list">
<table id="menulist" class="item_list" cellspacing="0" cellpadding="0" border="0">
	<thead class="fields">
        <tr>
            <th class="first center">&nbsp;&nbsp;#&nbsp;&nbsp;</th>
            <th><?php echo ucfirst($txt->getWord('title')); ?></th>
			<th><?php echo ucfirst($txt->getWord('free_shipping')); ?> <?php echo ucfirst($txt->getWord('start_date')); ?></th>
			<th><?php echo ucfirst($txt->getWord('free_shipping')); ?> <?php echo ucfirst($txt->getWord('end_date')); ?></th>
            <th><?php echo ucfirst($txt->getWord('active')); ?></th>
            <th><?php echo ucfirst($txt->getWord('edit').' '.$txt->getWord('zones')); ?></th>
            <th class="last"><?php echo ucfirst($txt->getWord('delete')); ?></th>
        </tr>
    </thead>
    <tbody>
        <tr class="items">
            <td class="first center">0</td>
            <td><input class="medium" id="new_shipping" name="new_shipping[]" type="text" value="" maxlength="50" /></td>
            <td colspan="2">&nbsp;</td>
            <td class="center">
            	<img 
                	title="<?php echo ucfirst($txt->getWord('new')); ?>"
                    class="icon command" 
                    src="<?php echo SYSICONS_URL; ?>add_16.gif" 
                    onclick="if(document.getElementById('new_shipping').value != '') { edit_form.submit(); }" />
            </td>
            <td class="last">&nbsp;</td>
        </tr>
        <?php 
        if($shmethods):
        foreach($shmethods as $shmethod)
        {
			if(((is_numeric($_GET['type'])) && ($shmethod['type'] == $_GET['type'])) || (!(is_numeric($_GET['type']))))
			{
			?>
            <tr class="items">
				<td class="first center"><?php echo $shmethod['id']; ?><input type="hidden" name="shipping_id[]" value="<?php echo $shmethod['id']; ?>" /></td>
				<td><input class="medium" name="shipping_title[]" type="text" value="<?php echo $shmethod['title']; ?>" maxlength="50" /></td>
				<td class="center">
					<input alt="fsdae<?php echo $shmethod['id']; ?>" id="fsdas<?php echo $shmethod['id']; ?>" type="text" name="FreeShippingDateActiveStart[]" class="date_range_start date_pick xsmall-s" value="<?php if($shmethod['FreeShippingDateActiveStart'] != '0000-00-00 00:00:00') { echo date('d.m.Y', strtotime($shmethod['FreeShippingDateActiveStart'])); } ?>" />
				</td>
				<td class="center">
					<input alt="fsdas<?php echo $shmethod['id']; ?>" id="fsdae<?php echo $shmethod['id']; ?>" type="text" name="FreeShippingDateActiveEnd[]" class="date_range_end date_pick xsmall-s" value="<?php if($shmethod['FreeShippingDateActiveEnd'] != '0000-00-00 00:00:00') { echo date('d.m.Y', strtotime($shmethod['FreeShippingDateActiveEnd'])); } ?>" />
				</td>
				<td class="center"><?php echo $commander->getActivationFields($shmethod); ?><input type="hidden" name="shipping_active[]" value="<?php echo $shmethod['active']; ?>" /></td>
				<td class="center">
					<a href="?con=<?php echo $_REQUEST['con']; ?>&shipping=<?php echo $shmethod['id']; ?>"><img title="<?php echo ucfirst($txt->getWord('edit')); ?>" class="icon command" src="<?php echo SYSICONS_URL; ?>configure_16.gif" onclick="edit_form.submit();"  /></a>
				</td>
				<td class="last center">
					<input title="<?php echo ucfirst($txt->getWord('delete')); ?>" class="inp_image" type="image" name="delete_shipping" src="<?php echo SYSICONS_URL; ?>delete_16.gif" value="0" onclick="this.value='<?php echo $shmethod['id']; ?>'; edit_form.submit();" />
				</td>
			</tr>
			<?php
			}
        }
        endif; 
        ?>
	</tbody>
</table>
</div>